<?php
/**
 * Created by PhpStorm.
 * User: macmini
 * Date: 2018/2/28
 * Time: 下午4:16
 */

namespace app\common\model;

use think\Model;

class Goods extends Model {
    protected function getStatusAttr($value)
    {
        $status = [1 => '已上架',2 => '已下架'];
        return ['val' => $value, 'text' => $status[$value]];
    }
    protected function getCateNameAttr($value, $data) {
        $name = model('Cates')->where('id', $data['cid'])->value('name');
        return $name;
    }
}
